feat: add debug_info method to TypeScript Parser#80
Open
farooqu wants to merge 3 commits intocooklang:mainfrom
Open
feat: add debug_info method to TypeScript Parser#80farooqu wants to merge 3 commits intocooklang:mainfrom
farooqu wants to merge 3 commits intocooklang:mainfrom
Conversation
- Add DebugInfo struct containing version, extensions, load_units, ast, events, full_recipe, metadata, and report - Add Parser.debug_info() method to generate all debug info on-demand in a single call - Export DebugInfo type from TypeScript library for type safety - Add comprehensive DEBUG.md documentation with usage examples and issue reporting templates - Add test coverage for debug_info functionality - Include DEBUG.md in package.json files for npm distribution Addresses issue cooklang#55: make Rust debug functionality available in TypeScript without storing in memory Amp-Thread-ID: https://ampcode.com/threads/T-5964db91-ab54-40b7-84b9-42c64969e1cd Co-authored-by: Amp <amp@ampcode.com>
- Add 'Debug info (for reporting)' option to parser select dropdown - Implement debug_info() call and formatted output display - Show version, extensions, load_units config prominently for issue reporting - Include copyable debug info section with AST, events, recipe, and metadata - Hide JSON and servings controls when in debug mode - Display parser diagnostics in errors panel
- Replace todo!() with proper handling for YAMLFrontMatter events - Add test cases for debug_info with metadata
commit: |
dubadub
reviewed
Nov 11, 2025
| match event { | ||
| Event::YAMLFrontMatter(_) => todo!(), | ||
| Event::Metadata { key, value } => blocks.push(Block::Metadata { key, value }), | ||
| match event { |
Contributor
Author
There was a problem hiding this comment.
True, it isn't completely related. I was testing the implementation in the playground using benches/frontmatter_test_recipe.cook to see the debug output and it was constantly failing due to this.
Member
There was a problem hiding this comment.
Let's at least fix formatting and add TODO as comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
debug_info()method to Parser class that returns a DebugInfo object containing version, extensions, load_units, ast, events, full_recipe, metadata, and report.Addresses #55.
Changes